import React, {Component} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import {ScreenDimensions} from "../../libs/utils/ScreenDimensions";


type TitlePropsType = {
    title:string,
}

export default class TitleView extends Component<TitlePropsType, any> {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <View style={TitleViewStyle.titleContainer}>
                <View style={TitleViewStyle.titleBar}>
                    <View style={TitleViewStyle.left}>
                        <Text style={TitleViewStyle.leftText}>{''}</Text>
                    </View>
                    <View style={TitleViewStyle.middle}>
                        <Text style={TitleViewStyle.middleTitle} numberOfLines={1} >{this.props.title}</Text>
                    </View>
                    <View style={TitleViewStyle.right}>
                        <Text style={TitleViewStyle.rightText}>{''}</Text>
                    </View>
                </View>
            </View>
        );
    }
}




const TitleViewStyle = StyleSheet.create({
    titleContainer: {
        height: ScreenDimensions.navigationBar.height,
        flexDirection: 'column', // 沿y轴
        justifyContent: 'center', // 沿y轴居中
        backgroundColor:'#ffffff'
    },
    titleBar: {
        flexDirection: 'row', // 沿x轴
        justifyContent: 'space-between',// 沿x轴左中右分布
    },
    left: {
    },
    leftText: {
        fontSize: 18,
        color: "#000000",
    },
    middle: {
    },
    middleTitle: {
        fontSize: 18,
        color: "#000000",
    },
    right: {
    },
    rightText: {
        fontSize: 18,
        color: "#000000",
    }

});
